load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
    name = "hash64_equals_lib",
    srcs = ["hash64_equals_generator.go"],
    importpath = "github.com/pingcap/tidb/pkg/planner/core/generator/hash64_equals",
    visibility = ["//visibility:private"],
    deps = [
        "//pkg/parser/types",
        "//pkg/planner/cascades/base",
        "//pkg/planner/core/operator/logicalop",
    ],
)

go_binary(
    name = "hash64_equals",
    embed = [":hash64_equals_lib"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "hash64_equals_test",
    timeout = "short",
    srcs = ["hash64_equals_test.go"],
    data = [
        "//pkg/planner/core/operator/logicalop:generator_files",
    ],
    embed = [":hash64_equals_lib"],
    flaky = True,
    deps = [
        "//pkg/util",
        "@com_github_stretchr_testify//require",
    ],
)
